package com.xmut.mall.product.feign;

import com.xmut.mall.product.utils.RespBean;
import com.xmut.mall.product.vo.MemberCartEntityVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient("mall-member")
public interface MemberFeignService {

    /**
     * 根据传入的购物车项获取当前用户结算时可用的优惠券
     * @param list
     * @return
     */
    @PostMapping("/member/membercoupon/getUserAllCanUseCouponByCART")
    RespBean getUserAllCanUseCouponByCART(@RequestBody List<MemberCartEntityVo> list);

    /**
     * 获取用户购物车中进行结算的购物车项
     * @param userId
     * @return
     */
    @GetMapping("/member/membercart/getUserCheckedCartEntityItem/{userId}")
    RespBean getUserCheckedCartEntityItem(@PathVariable Long userId);

    /**
     * 获取用户购物车中目前选中的购物车项的信息
     * @param params
     * @return
     */
    @PostMapping("/member/membercart/getUserCheckedCartItem")
    RespBean getUserCheckedCartItem(@RequestBody Map<String,Object> params);

    /**
     * 获取用户领取的优惠券中 全部的 可以使用后的优惠券
     * @param params
     * @return
     */
    @PostMapping("/member/membercoupon/getUserAllCanUseCoupon")
    RespBean getUserAllCanUseCoupon(@RequestBody Map<String,Object> params);
}
